<div class="form-group">
    <label class="col-sm-2 control-label">商品名称</label>
    <div class="col-sm-10">
        <input type="text" class="form-control" name="{{ form_name }}[name]" required="required" value="{{ entity.name }}">
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">品牌</label>
    <div class="col-sm-4">
        <select id='brand_list' class="form-control search-select"
                name="{{ form_name }}[brandId]" data-rel="tooltip">
            {% if not entity.id > 0 %}
                <option value="0">--请选择品牌--</option>
            {% endif %}

            {% for item in brandList %}
                <option value="{{ item.id }}"
                        {% if entity.brandId == item.id %}
                            selected="selected"
                        {% endif %}
                        >{{ item.name }}</option>
            {% endfor %}

        </select>
    </div>

    <label class="col-sm-1 control-label">门店</label>
    <div class="col-sm-4">
        <select id='shop_list' class="form-control search-select"
                name="{{ form_name }}[shopId]" data-rel="tooltip">
            {% if not entity.id > 0 %}
                <option value="0">--请选择门店--</option>
            {% endif %}

            {% for item in shopList %}
                <option value="{{ item.id }}"
                        {% if entity.shopId == item.id %}
                            selected="selected"
                        {% endif %}
                        >{{ item.name }}</option>
            {% endfor %}

        </select>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">商品简介</label>
    <div class="col-sm-10">
        <textarea class="form-control" rows="4" cols="20" name="{{ form_name }}[description]" required="required">{{ entity.description }}</textarea>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">商品价格</label>
    <div class="col-sm-2">
        <input type="number" class="form-control" name="{{ form_name }}[price]" value="{{ entity.price }}" required="required">
    </div>

    <label class="col-sm-1 control-label">市场价</label>
    <div class="col-sm-2">
        <input type="number" class="form-control" name="{{ form_name }}[originPrice]" value="{{ entity.originPrice }}" required="required">
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">有效期</label>
    <div class="col-sm-5">
        <input type="text" class="form-control daterange" name="{{ form_name }}[lifeTime]" value="{{ entity.lifeTime }}" required="required">
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">库存量</label>
    <div class="col-sm-3">
        <input type="number" class="form-control" name="{{ form_name }}[countAll]" value="{{ entity.countAll }}" required="required">
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">一次最少购买数量</label>
    <div class="col-sm-8">
        <input type="number" class="form-control inline" name="{{ form_name }}[minBuyCount]" value="{{ entity.minBuyCount }}" required="required">
        <span>*购买数量低于此设定值不允许参团</span>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">一次最多购买数量</label>
    <div class="col-sm-8">
        <input type="number" class="form-control inline" name="{{ form_name }}[maxBuyCount]" value="{{ entity.maxBuyCount | default(0) }}" required="required">
        <span>*0表示不限制</span>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">是否开启购物车</label>
    <input type="checkbox" name="{{ form_name }}[enableShopCart]" value="{{ entity.enableShopCart }}"
            {% if entity.enableShopCart == 1%}
            checked="checked">
            {% else %}
            >
            {% endif %}
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">下单开启手机验证</label>
    <input type="checkbox" name="{{ form_name }}[enablePhoneVerify]" value="{{ entity.enablePhoneVerify }}"
            {% if entity.enableShopCart == 1%}
           checked="checked">
            {% else %}
                >
            {% endif %}
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">购买须知</label>
    <div class="col-sm-10">
        <div id="buy_detail_editor">

        </div>
        <textarea id="buy_detail" class="form-control" style="display: none;"
                  name="{{ form_name }}[buyDetail]" required="required">{{ entity.buyDetail }}</textarea>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">商品详情</label>
    <div class="col-sm-10">
        <div id="prod_detail_editor">

        </div>
        <textarea id="prod_detail" class="form-control" style="display: none;"
                  name="{{ form_name }}[detail]" required="required">{{ entity.detail }}</textarea>
    </div>
</div>

